{template 'common/header'} 

 {if $op == 'display'}
<div class="main">

	<div class="panel panel-default">
		<div class="panel-heading">人脉列表</div>
		<div class="panel-body">
			<div class="table-responsive panel-body">
				<table class="table table-hover" style="min-width: 300px;">
					<thead class="navbar-inner">
						<tr>
							<th class="col-sm-2">昵称</th>
							<th class="col-sm-3">微信号</th>
							<th class="col-sm-3">二维码</th>
							<th class="col-sm-3">是否推荐</th>
											
							<th class="col-sm-2 text-right">操作</th>
						</tr>
					</thead>
					<tbody>
					
						{loop $messagelist $individualid $individualies}
						<tr>
							<td>{$individualies['nickname']}</td>													
							<td>{$individualies['weixin']}</td>
							
							
							<td><img src="{php echo tomedia($individualies['ewm'])}" alt="" width="100"></td>
							<td>{if $individualies['recommended'] == 1}是{else}否{/if}</td>
							<td class="text-right">
								<a href="{php echo $this->createWebUrl('remmai', array('op'=>'weixin', 'id'=>$individualies['id']));}" class="btn btn-default" >编辑 </a>
								<a onclick="if(!confirm('删除后将不可恢复,确定删除吗?')) return false;" href="{php echo $this->createWebUrl('remmai', array('op'=>'delete', 'id'=>$individualies['id']));}" class="btn btn-default btn-danger" data-toggle="tooltip" data-placement="top" title="" data-original-title="删除">删除</a>
							</td>
						</tr>
						{/loop}
						{if empty($business)}
						<tr>
							<td colspan="8">
								未发现更多会员
							</td>
						</tr>
						{/if}
					</tbody>
				</table>
				{$pager}
			</div>
		</div>
	</div>
</div>
 {/if}
 {if $op == 'weixin'}
	<form action="" method="post" class="form-horizontal form" id="form" style="padding-bottom:55px">
		<div class="panel panel-default">
		<div class="panel-heading">个人信息</div>
		<div class="panel-body">
		<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">微信号</label>
					<div class="col-xs-12 col-sm-8">
						<input type="text" name="business[weixin]" class="form-control" value="{$business['weixin']}" />						
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">选择性别</label>
					<div class="col-xs-12 col-sm-8">
						<select class="form-control" name="business[sex]">
					
					  <option value="1">男神</option>
					  <option value="2">女神</option>
					 
				</select>
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">个人一句话介绍</label>
					<div class="col-xs-12 col-sm-8">
						<input type="text" name="business[yjh]" class="form-control" value="{$business['yjh']}" />						
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">头像</label>
					<div class="col-xs-12 col-sm-8">
						{php echo tpl_form_field_image('business[avatar]', $business['avatar']);}
					</div>
				</div>
	
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">二维码</label>
					<div class="col-xs-12 col-sm-8">
						{php echo tpl_form_field_image('business[ewm]', $business['ewm']);}
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">二维码</label>
					<div class="col-xs-12 col-sm-8">
						{php echo tpl_form_field_image('business[ewm]', $business['ewm']);}
					</div>
				</div>
				
			</div>
			<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label">是否推荐</label>
					<div class="col-sm-9 col-xs-12">
						<label class='radio-inline'><input type="radio" name="business[recommended]" value="1"  {if $business['recommended'] == 1} checked="true" {/if} > 开启</label>
						<label class='radio-inline'><input type="radio" name="business[recommended]" value="0"  {if $business['recommended'] == 0} checked="true" {/if} > 关闭</label>
						
					</div>
				</div>
			<div class="panel-body">
				{if !empty($id)}
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">添加日期</label>
					<div class="col-xs-12 col-sm-8">
						<p class="form-control-static">{php echo date('Y-m-d H:s:i', $business['time']);}</p>
					</div>
				</div>
				
				{/if}
			
                    
                      
        </div>
				<div class="form-group">
					<div class="col-xs-12 col-sm-9 col-md-10 col-lg-10 col-sm-offset-3 col-md-offset-2 col-lg-offset-2">						
						<input name="submit" type="submit" value="提交" class="btn btn-primary" />
						<input type="hidden" name="token" value="{$_W['token']}" />
					</div>
				</div>
			</div>
		</div>
	</form>
</div>
 
<script>
require(['jquery', 'util'], function($, util){
	$(function(){
		$('#form').submit(function(){			
			if($('input[name="business[weixin]"]').val() == ''){
				util.message('请填写您的微信号.');
				return false;
			}
			
							
			return true;
		});
	});
});
</script>
{/if}
{template 'common/footer'}